From: Alynx Zhou Date: Fri, 9 May 2025 04:16:52 +0000 (+0800) Subject: status/network: Fix VPN toggle not working when clicking the switch X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~124^2^2~86 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7b259a67d75b579d95505edbfec11951ff3d52a6;p=gnome-shell.git status/network: Fix VPN toggle not working when clicking the switch VPN activation is triggered by clicking/touching the item, however, the switch is reactive and blocks clicking/touching event so item won't be activated. Manually activate item when switch is toggled to fix that. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8204 Part-of: --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index ee9b22937..69337ca99 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1323,6 +1323,16 @@ const NMVpnConnectionItem = GObject.registerClass({ this.bind_property('is-active', this._switch, 'state', GObject.BindingFlags.SYNC_CREATE); + + // Switch handle is reactive, so events don't propagate to the item; + // activate it manually in that case + this._switch.connect('notify::state', () => { + if (this.is_active === this._switch.state) + return; + + this.activate(); + }); + this.bind_property('name', this._label, 'text', GObject.BindingFlags.SYNC_CREATE);